Completed
Push — master ( 158ed8...34f194 )
by Alejandro
04:53 queued 02:19
created

ExternalLink.js ➔ ExternalLink   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 8
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
crap 2
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
4 7
const propTypes = {
5
  href: PropTypes.string.isRequired,
6
  children: PropTypes.node,
7
};
8
9
export default function ExternalLink(props) {
10
  const { href, children, ...rest } = props;
11
12
  return (
13
    <a target="_blank" rel="noopener noreferrer" href={href} {...rest}>
14
      {children || href}
15
    </a>
16
  );
17
}
18
19
ExternalLink.propTypes = propTypes;
20